package cm.day10;

import java.io.FileWriter;
import java.io.IOException;

public class Test5 {
    public static void main(String[] args) {
test1();
    }
    public static void test1(){
        FileWriter fw= null;
        try {
            fw = new FileWriter("d:/bbb/ccc.txt");
            fw.write("Helloword");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }
        try {
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static void test2(){
        try (FileWriter fw=new FileWriter("d/bbb/ccc.txt")){
            fw.write("Helloworld");
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
